comment |
   This short program turns off the Num Lock light and key.  You can
   add it to your Autoexec.Bat file if you want your computer to boot
   up with the Num Lock turned off.  Lines that have been commented out
   also show how to turn on and off the Caps Lock and Scroll Lock.
   Save as NUMOFF.ASM
   Compile:	MASM NUMOFF;
   		LINK NUMOFF;   (ignore no-stack warning)
		EXE2BIN NUMOFF.EXE NUMOFF.COM
   |

cseg	segment
	assume cs:cseg, ds:nothing, es:nothing

CAPSON	=	40h
CAPSOFF	=	0BFh

NUMON	=	20h
NUMOFF	=	0DFh

SCLON	=	10h
SCLOFF	=	0EFH
	
	org	100h				;.COM file format
start:	mov	ax,40h				;BIOS data area
	mov	es,ax				;  in ES
	and	byte ptr es:[17h],NUMOFF	;Turn off Num Lock

;	or	byte ptr es:[17h],NUMON		;Turn on Num Lock
;	and	byte ptr es:[17h],CAPSOFF	;Turn off Caps Lock
;	or	byte ptr es:[17h],CAPSON	;Turn on Caps Lock
;	and	byte ptr es:[17h],SCLOFF	;Turn off Scroll Lock
;	or	byte ptr es:[17h],SCLON		;Turn on Scroll Lock
	int	20h				;Fast way back to DOS
cseg		ends
		end	start


